import { Module } from '@nestjs/common'
import { UserController } from './user.controller'
import { UserService } from './user.service'
import { TypeOrmModule } from '@nestjs/typeorm'
import { User } from '../entities/user.entity'
import { JwtModule } from '@nestjs/jwt'
import { JwtConstant } from '../constant'

@Module({
  /**
   * 使用存储库
   */
  imports: [
    TypeOrmModule.forFeature([User]),
    JwtModule.register({
      secret: JwtConstant.SECRET, // 密钥
      signOptions: {
        expiresIn: JwtConstant.EXPIRES_IN, // 有效期
      },
    }),
  ],

  controllers: [UserController],
  providers: [UserService],
})
export class UserModule {}
